inherit NPC;
#include <ansi.h>

void heart_beat()
{
object me = this_object();
if ( random(20) && (me->is_busy() || !living(me)) )  {::heart_beat();return;}
if ( query("eff_kee") < query("max_kee") && !random(10) )
        SDS_D->addEffKee(me);
if ( query("kee") < query("eff_kee") )
        SDS_D->addKee(me);
if ( query("sen") < query("eff_sen") )
        SDS_D->addSen(me);
if ( query("eff_sen") < query("max_sen") && !random(5) )
        SDS_D->addEffSen(me);
::heart_beat();
if ( !me->is_fighting() )
        return;
if ( random(4) ) return;
switch(random(3))
        {
        case 0 : 
                if ( !query("no_pfm") ) 
                        SDS_D->randomPfm(this_object());
                break;
        case 1 : 
                if ( !query("no_cast") ) 
                        SDS_D->randomCast(this_object());
                break;
        default: 
                if ( !query("no_exert") )         
                        SDS_D->randomExert(this_object());
        }       
}

